*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: TABLE B1 (ONLINE APPENDIX)

***************************

cd ""

use "DTA files/Dataset", clear

* Set excel file where to store table
putexcel set "Tables/B1", modify

collapse v1=layoff_rate_1 v2=layoff_rate_2 v3=layoff_rate_3 v4=layoff_rate, by(industry)

egen id = group(industry)
sum id
local max = r(max)

matrix descriptive = J(`max',4,.)
mat rownames descriptive = 10t12 13t15 16t18 19 20t21 22t23 24t25 26t27 28 29t30 31t33 45 46 47 49t52 53 58t60 61 62t63 A B DtE F I K L MtN O P Q R S 

forvalues j = 1/4 {
forvalues i = 1/`max' {
sum v`j' if id==`i'
local mean`j' = r(mean)
sum id if id == `i'
local id = r(mean)
matrix descriptive[`i',`j'] = `mean`j''
}
}
putexcel B2=matrix(descriptive) 
